﻿using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using ExamRepositoryWebAPI.Models;
using ExamRepositoryWebAPI.DataRepositories;

namespace ExamRepositoryWebAPI.Controllers
{
    public class EaseAnswerQuestionController : Controller
    {
        private readonly IRepository<EaseAnswerQuestion, int> _repository;

        public EaseAnswerQuestionController(IRepository<EaseAnswerQuestion, int> repository)
        {
            _repository = repository;
        }
        public string Index()
        {
            return "SingleChoice Question Repository";
        }

        public ActionResult<List<EaseAnswerQuestion>> GetAllList()
        {
            return _repository.GetAllList();
        }

        public void Delete(EaseAnswerQuestion question)
        {
            _repository.Delete(question);
        }

        public ActionResult<EaseAnswerQuestion> Update(EaseAnswerQuestion question)
        {
            return _repository.Upadate(question);
        }

        public ActionResult<EaseAnswerQuestion> Insert(EaseAnswerQuestion question)
        {
            return _repository.Insert(question);
        }
    }
}
